export default {
  name: 'vTab',
  render (h) {
    return (
      <el-tabs onTab-click={this.tabClick} activeName={this.activeTab + ''} class='block'>
      {
        this.tabs.map((tab) => {
          // modified by Stephen: el-tab-pane add disabled attribute control
          return <el-tab-pane name={tab.name + ''} label={tab.label} disabled={tab.disabled}>{tab.content}</el-tab-pane>
        })
      }
      </el-tabs>
    )
  },
  props: {
    tabs: {
      type: Array,
      default () {
        return []
      }
    },
    activeTab: [String, Number]
  },
  methods: {
    tabClick (vm) {
      this.$emit('tab-click', vm)
    }
  }
}
